<template>
  <div>贴吧举报管理</div>
  <!-- 数据表格 -->
  <div>
    <NDataTable :loading="loading" :data="list" :columns="columns"></NDataTable>
  </div>
</template>

<script setup lang="ts">
import type { TbLog } from '@/types/admin/System'
import type { PageBean } from '@/types/BaseResult'
import { Tools } from '@/types/Tools'
import { NButton, NSpace, DataTableColumn } from 'naive-ui'
import { ref } from 'vue'

//#region 查询

const page = ref({ pageNumber: 1, pageSize: 5 } as PageBean)
const queryInfo = ref({ publisher: -1, gname: '' })
const list = ref([] as Array<TbLog>)

const columns = ref([
  {
    title: '标题',
    key: 'title',
  },
  {
    title: '删除理由',
    key: 'reason',
  },
  {
    title: '发布时间',
    key: 'created',
    render(row) {
      return Tools.formatDate(row.created as number, 'yyyy-MM-dd')
    },
  },
  {
    title: '状态',
    key: 'tbGamePublisher.publisher',
  },
  {
    title: '操作',
    key: 'action',
    render(row) {
      return h(NSpace, {}, [
        h(
          NButton,
          {
            sizi: 'small',
            type: 'info',
            onClick: () => {
              showModify(row)
            },
          },
          '修改',
        ),
        h(
          NButton,
          {
            sizi: 'small',
            type: 'error',
            onClick: () => {
              showDelete(row)
            },
          },
          '删除',
        ),
      ])
    },
  },
] as DataTableColumn<TbLog>[])
</script>

<style scoped lang="scss"></style>
